package com.xiaoming.moj.judge.codesandbox.impl;

import com.xiaoming.moj.judge.codesandbox.CodeSandBox;
import com.xiaoming.moj.judge.codesandbox.model.ExecuteCodeRequest;
import com.xiaoming.moj.judge.codesandbox.model.ExecuteCodeResponse;
import com.xiaoming.moj.model.dto.questionsubmit.JudgeInfo;
import com.xiaoming.moj.model.enums.JudgeInfoMessageEnum;
import com.xiaoming.moj.model.enums.QuestionSubmitStatusEnum;

import java.util.List;

/**
 * 实例代码沙箱
 */
public class ExampleCodeSandBox implements CodeSandBox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();

        ExecuteCodeResponse executeCodeResponse=new ExecuteCodeResponse();
        executeCodeResponse.setMessage("成功");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
        JudgeInfo judgeInfo=new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPTED.getText());
        judgeInfo.setMemory(100l);
        judgeInfo.setTime(100l);
        executeCodeResponse.setJudgeInfo(judgeInfo);
        executeCodeResponse.setOutPutList(inputList);
        return executeCodeResponse;


    }
}
